<?php
declare (strict_types=1);

namespace app\command;

use app\model\game\GameProcessModel;
use think\console\Command;
use think\console\Input;
use think\console\Output;

/**
 * 指令-趣豆商城-每天晚上结算当前玩家抽盲盒情况
 * Class CheckGameSettle
 * @package app\command
 */
class CheckGameSettle extends Command
{
    protected function configure()
    {
        $this->setName('check_game_settle_timeout')->setDescription('the check_game_settle_timeout command');
    }

    /**
     * @param Input $input
     * @param Output $output
     * @return int|null|void
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    protected function execute(Input $input, Output $output)
    {
        //盲盒游戏结算
        $start_time = strtotime(date("Y-m-d"));
        $end_time = strtotime(date("Y-m-d") . " 23:59:59");
        GameProcessModel::getSettleSale($start_time, $end_time);
        echo "success";
    }
}
